﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.Drawing;
using ZOIL.DataModel;

namespace ZOIL.DataBackend
{
    [Export(typeof(CollectionConnectionBase))]
    public class LocalOnlyCollectionConnection : CollectionConnectionBase
    {
        #region Implementation of IConnection

        public override string FriendlyName
        {
            get { return "Local Only"; }
        }

        public override Bitmap Icon
        {
            get { return null; }
        }

        public override IPersistableCollection Connect(Dictionary<string, object> parameters)
        {
            return new LocalOnlyCollection();
        }

        public override IList<T> CreateList<T>()
        {
            return new List<T>();
        }

        public override ObservableCollection<T> CreateObservableCollection<T>()
        {
            return new ObservableCollection<T>();
        }

        public override bool CanStartLocalDatabase()
        {
            return false;
        }

        public override void StartLocalDatabase(Dictionary<string, object> parameters)
        {
            throw new System.NotImplementedException();
        }

        public override void Dispose()
        {
            // ignore
        }

        #endregion
    }
}